package com.itheima.exer.exercise.ex0924;

import java.math.BigDecimal;

public class Demo3 {
    public static void main(String[] args) {
        String str = "91.4 27.23 46.4 38.7 50.2";
        String[] split = str.split(" ");
        BigDecimal bigDecimal = new BigDecimal(split[0]);
        for (int i = 1; i < split.length; i++) {
            BigDecimal bigDecimal1 = new BigDecimal(split[i]);
            bigDecimal = bigDecimal.add(bigDecimal1);
        }
        BigDecimal bigDecimal2 = new BigDecimal(split.length);
        BigDecimal divide = bigDecimal.divide(bigDecimal2, 2, BigDecimal.ROUND_HALF_UP);
        System.out.println(divide);
    }
}
